Protocol methods can be marked as optional using the @optional keyword. Corresponding to the @optional modal keyword, there is a @required keyword to formally denote the semantics of the default behavior. You can use @optional and @required to partition your protocol into sections as you see fit. If you do not specify any keyword, the default is @required, or you can say that the @optional directive applies to any methods that follow it, either until the end of the protocol definition, or until another directive is encountered, such as @required. For example:
Tarun Kumar
03-Oct-2015Protocol methods can be marked as optional using the @optional keyword. Corresponding to the @optional modal keyword, there is a @required keyword to formally denote the semantics of the default behavior. You can use @optional and @required to partition your protocol into sections as you see fit. If you do not specify any keyword, the default is @required, or you can say that the @optional directive applies to any methods that follow it, either until the end of the protocol definition, or until another directive is encountered, such as @required.
For example: